package com.fengye.lock.db.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fengye.lock.db.domain.UserAccount;
import com.fengye.lock.db.mapper.UserAccountMapper;
import com.fengye.lock.db.service.UserAccountService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *
 */
@Service
public class UserAccountServiceImpl extends ServiceImpl<UserAccountMapper, UserAccount>
        implements UserAccountService {

    @Resource
    private UserAccountMapper userAccountMapper;

    @Override
    public int updateAmountById(Double money, Integer id) {
        return userAccountMapper.updateAmountById(money, id);
    }

    @Override
    public int updateAmountByIdAndVersion(Double money, Integer id, Integer version) {
        return userAccountMapper.updateAmountByIdAndVersion(money, id, version);
    }

    @Override
    public UserAccount selectByUserIdLock(Integer userid) {
        return this.getBaseMapper().selectByUserIdLock(userid);
    }

    @Override
    public int updateAmountLock(Double money, Integer id) {
        return this.getBaseMapper().updateAmountLock(money, id);
    }
}




